<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%= stylesheet_link_tag 'screen' %>
<%= javascript_include_tag :defaults %>
<title>Bill Tracker<%= " | #{@page_title}" if @page_title %></title>
</head>

<body>
<div id="page">
  <div id="top"></div>
  <%= render :partial => 'shared/messages' %>
  <div id="middle">
  
    <div class="menu" id="left-menu">
      <span id="image"><%= image_tag 'icons/home.png' %></span>
      <%= link_to 'Home', :controller => 'user', :action => 'home' %> |
      <span id="image"><%= image_tag 'icons/bills.png' %></span>
      <%= link_to 'Bills', :controller => 'bill' %> |
      <span id="image"><%= image_tag 'icons/accounts.png' %></span>
      <%= link_to 'Accounts', :controller => 'accounts' %> |
      <span id="image"><%= image_tag 'icons/history.png' %></span>
      <%= link_to 'History', :controller => 'history' %>
      <% if current_user && current_user.is_admin? -%>
      | <span id="image"><%= image_tag 'icons/admin.png' %></span>
      <%= link_to 'Admin', :controller => 'admin' %>
      <% end -%>
    </div>
    
    <div class="menu" id="right-menu">
      <% if current_user -%>
        <span id="image"><%= image_tag 'icons/user.png' %></span>
        <%= link_to current_user.username, { :controller => 'user', :action => 'profile' }, :class => 'stronger' %> |
        <%= link_to 'Logout', :controller => 'user', :action => 'logout' %>
      <% else -%>
        <span id="image"><%= image_tag 'icons/login.png' %></span>
        <%= link_to 'Login', :controller => 'user', :action => 'login' %>
      <% end -%>
    </div>
    
    <div id="end-menu"></div>

    <%= yield %>
  </div>
  <div id="bottom"></div>
</div>
</body>
</html>
